package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GradeInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Grade_Info", schema = "dbo", catalog = "StudentManager")
public class GradeInfo implements java.io.Serializable {

	// Fields

	private Long gradeId;
	private String grade;
	private Set<ClassInfo> classInfos = new HashSet<ClassInfo>(0);

	// Constructors

	/** default constructor */
	public GradeInfo() {
	}

	/** minimal constructor */
	public GradeInfo(Long gradeId, String grade) {
		this.gradeId = gradeId;
		this.grade = grade;
	}

	/** full constructor */
	public GradeInfo(Long gradeId, String grade, Set<ClassInfo> classInfos) {
		this.gradeId = gradeId;
		this.grade = grade;
		this.classInfos = classInfos;
	}

	// Property accessors
	@Id
	@Column(name = "Grade_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getGradeId() {
		return this.gradeId;
	}

	public void setGradeId(Long gradeId) {
		this.gradeId = gradeId;
	}

	@Column(name = "Grade", nullable = false, length = 10)
	public String getGrade() {
		return this.grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "gradeInfo")
	public Set<ClassInfo> getClassInfos() {
		return this.classInfos;
	}

	public void setClassInfos(Set<ClassInfo> classInfos) {
		this.classInfos = classInfos;
	}

}